I overlooked one level of indirection here. Oops.
{
cairo_path_t *path;
GtkBorder border;
- GdkRGBA border_color;
+ GdkRGBA *border_color;
if (vertical)
path_from_vertical_line_rects (cr, (GdkRectangle *)lines->data, lines->len);
gtk_style_context_get_border (context, &border);
cairo_set_line_width (cr, border.left);
- gdk_cairo_set_source_rgba (cr, &border_color);
+ gdk_cairo_set_source_rgba (cr, border_color);
cairo_stroke (cr);
+ gdk_rgba_free (border_color);
}
g_array_free (lines, TRUE);
/* Render the border of the arrow tip */
if (border.bottom > 0)
{
- GdkRGBA border_color;
+ GdkRGBA *border_color;
gtk_style_context_get (context, "border-color", &border_color, NULL);
gtk_popover_apply_tail_path (popover, cr);
- gdk_cairo_set_source_rgba (cr, &border_color);
+ gdk_cairo_set_source_rgba (cr, border_color);
cairo_set_line_width (cr, border.bottom + 1);
cairo_stroke (cr);
+ gdk_rgba_free (border_color);
}
cairo_restore (cr);
_gtk_style_context_get_attributes (AtkAttributeSet *attributes,
GtkStyleContext *context)
{
+ GdkRGBA *bg;
GdkRGBA color;
gchar *value;
- gtk_style_context_get (context, "background-color", &color, NULL);
+ gtk_style_context_get (context, "background-color", &bg, NULL);
value = g_strdup_printf ("%u,%u,%u",
- (guint) ceil (color.red * 65536 - color.red),
- (guint) ceil (color.green * 65536 - color.green),
- (guint) ceil (color.blue * 65536 - color.blue));
+ (guint) ceil (bg->red * 65536 - bg->red),
+ (guint) ceil (bg->green * 65536 - bg->green),
+ (guint) ceil (bg->blue * 65536 - bg->blue));
attributes = add_attribute (attributes, ATK_TEXT_ATTR_BG_COLOR, value);
g_free (value);
+ gdk_rgba_free (bg);
gtk_style_context_get_color (context, &color);
value = g_strdup_printf ("%u,%u,%u",
int byte_offset = 0;
PangoLayoutIter *iter;
int screen_width;
- GdkRGBA selection;
+ GdkRGBA *selection;
gboolean first = TRUE;
GtkCssNode *selection_node;
cairo_t *cr = text_renderer->cr;
cairo_save (cr);
- gdk_cairo_set_source_rgba (cr, &selection);
+ gdk_cairo_set_source_rgba (cr, selection);
cairo_rectangle (cr,
line_display->left_margin, selection_y,
screen_width, selection_height);
cairo_clip (cr);
cairo_region_destroy (clip_region);
- gdk_cairo_set_source_rgba (cr, &selection);
+ gdk_cairo_set_source_rgba (cr, selection);
cairo_rectangle (cr,
PANGO_PIXELS (line_rect.x),
selection_y,
{
cairo_save (cr);
- gdk_cairo_set_source_rgba (cr, &selection);
+ gdk_cairo_set_source_rgba (cr, selection);
cairo_rectangle (cr,
line_display->left_margin,
selection_y,
cairo_save (cr);
- gdk_cairo_set_source_rgba (cr, &selection);
+ gdk_cairo_set_source_rgba (cr, selection);
cairo_rectangle (cr,
PANGO_PIXELS (line_rect.x) + PANGO_PIXELS (line_rect.width),
selection_y,
/* draw text under the cursor if any */
if (!line_display->cursor_at_line_end)
{
- GdkRGBA color;
+ GdkRGBA *color;
gtk_style_context_get (context, "background-color", &color, NULL);
- gdk_cairo_set_source_rgba (cr, &color);
+ gdk_cairo_set_source_rgba (cr, color);
text_renderer_set_state (text_renderer, CURSOR);
line,
line_rect.x,
baseline);
+ gdk_rgba_free (color);
}
cairo_restore (cr);
}
while (pango_layout_iter_next_line (iter));
+ gdk_rgba_free (selection);
pango_layout_iter_free (iter);
}
GtkTextAttributes *values)
{
const GdkRGBA black = { 0, };
+ GdkRGBA *bg;
if (!values->appearance.bg_rgba)
values->appearance.bg_rgba = gdk_rgba_copy (&black);
if (!values->appearance.fg_rgba)
values->appearance.fg_rgba = gdk_rgba_copy (&black);
- gtk_style_context_get (context, "background-color", values->appearance.bg_rgba, NULL);
+
+ gtk_style_context_get (context, "background-color", &bg, NULL);
+ *values->appearance.bg_rgba = *bg;
+ gdk_rgba_free (bg);
gtk_style_context_get_color (context, values->appearance.fg_rgba);
if (values->font)
{
GtkStyleContext *context;
const GdkRGBA black = { 0, };
+ GdkRGBA *bg;
if (!values->appearance.bg_rgba)
values->appearance.bg_rgba = gdk_rgba_copy (&black);
context = gtk_widget_get_style_context (GTK_WIDGET (text_view));
- gtk_style_context_get (context, "background-color", values->appearance.bg_rgba, NULL);
+ gtk_style_context_get (context, "background-color", &bg, NULL);
+ *values->appearance.bg_rgba = *bg;
+ gdk_rgba_free (bg);
gtk_style_context_get_color (context, values->appearance.fg_rgba);
if (values->font)